package com.tan.androidtest.java;

/**
 * 测试Try Catch Finally
 */

public class TestTryCatchFinally {

    public static void main(String[] args) {
        //int b = 10;
        //byte d = 10;

//        Integer i=10;
//        Double d=10d;
//
//        System.out.println(i==d);

//        System.out.println(test(b));
//
//        TestTryCatchFinally testTryCatchFinally = new TestTryCatchFinally();
//
//        System.out.println("和是:" + testTryCatchFinally.add(9, 34));

    }


    public static int test(int b) {
        try {
            b += 10;
            return b;
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            b += 10;
            return b;
        }
    }

    public int add(int a, int b) {
        try {
            return a + b;
        } catch (Exception e) {
            System.out.println("catch语句块");
        } finally {
            System.out.println("finally语句块");
        }
        return 0;
    }
}